#! /bin/bash
export LANG=zh_CN.UTF-8
PRESTO_HOME=/export/server/presto/bin/presto

#改写上述的模板 练习一下如何使用shell执行presto sql

/export/server/presto/bin/presto --catalog hive --server hadoop01:8090 --execute "
CREATE DATABASE IF NOT EXISTS edu_das;

CREATE TABLE hive.edu_das.das_absent_result
AS SELECT * FROM hive.edu_dm.dm_absent_result;


CREATE TABLE hive.edu_das.das_late_result
AS SELECT * FROM hive.edu_dm.dm_late_result;


CREATE TABLE hive.edu_das.das_leave_result
AS SELECT * FROM hive.edu_dm.dm_leave_result;


CREATE TABLE hive.edu_das.das_signin_result
AS SELECT * FROM hive.edu_dm.dm_signin_result;
"